package com.github.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Person {

	private long id;

	private String name;

	private String sex;

	private boolean local;

	private Date birthday;
	
	public Person(){}
	

	public Person(int id, String name, boolean local, Date birthday) {
		this.id = id;
		this.name = name;
		this.local = local;
		this.birthday = birthday;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public boolean isLocal() {
		return local;
	}

	public void setLocal(boolean local) {
		this.local = local;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getBirthdayStr() {
		if (birthday == null) {
			return null;
		}
		return new SimpleDateFormat("yyyy-MM-dd").format(birthday);
	}

	@Override
	public String toString() {
		return id + "\t" + name + "\t" + sex + "\t" + local + "\t" + getBirthdayStr();
	}
}
